package com.util.character;

/**
 * 字符串反转：Java 的反转函数 reverse() 将字符串反转。需要用StringBuffer的字符串
 */
public class Reversal {
    public static void main(String[] args) {
        String str = "The greatest test of courage on earth is to bear defeat without losing heart";
        String reverse = new StringBuffer(str).reverse().toString();
        System.out.println("字符串反转前" + str);
        System.out.println("字符串反转后" + reverse);
    }
}
